package com.cloud.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloud.api.domain.sys.SysDept;
import com.cloud.api.domain.sys.SysDeptDto;
import com.cloud.api.domain.sys.SysDeptQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 部门表 Mapper 接口
 * </p>
 *
 * @author haohaibo
 * @since 2023-08-01
 */
public interface SysDeptMapper extends BaseMapper<SysDept> {

    IPage<SysDeptDto> selectDeptList(IPage<?> page, @Param("c") SysDeptQuery para);

    List<SysDeptDto> getDeptListEnable();

    //通过userid查询本部部门
    List<SysDept> selectDeptsList(@Param("roleId") String roleId,@Param("type")String type);

    //    List<SysDept> selectDeptAndFollowDept(@Param("deptIds") List<String> deptIds);
    List<SysDept> selectDeptAndFollowDept(@Param("deptId") String deptId,@Param("type")String type);

    IPage<SysDept> getDeptListByCondition(IPage<?> page, @Param("c") SysDeptQuery para);

    SysDept containDeptId(@Param("c")SysDept sysDept);

    List<SysDept>selectAllDeptAndFollow(@Param("deptId") String deptId);

    List<SysDept> selectAuthLList(@Param("type") String type);

}